difference between #define and enum{} in C

Posted by guest on Stack Overflow See other posts from Stack Overflow or by guest
Published on 2010-06-14T07:25:58Z Indexed on 2010/06/14 7:32 UTC
Read the original article Hit count: 121

Filed under:
|
|
|

when should one use

enum {BUFFER = 1234}; 

over

#define BUFFER 1234    

?

what are the advantages enum brings compared to #define? i know, that #define is just simple text substitution and enum names the constant somehow. but why would one need that at all?

© Stack Overflow or respective owner

Related posts about c

    Related posts about preprocessor